package org.codeart.boss.service;

import org.codeart.boss.remote.ServiceDriverUserClient;
import org.codeart.common.dto.DriverCarBindingRelationship;
import org.codeart.common.util.HttpStatus;
import org.codeart.common.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RelationshipService {
    
    @Autowired
    private ServiceDriverUserClient serviceDriverUserClient;
    
    public boolean bind(DriverCarBindingRelationship driverCarBindingRelationship) {
        R<Void> r = serviceDriverUserClient.bind(driverCarBindingRelationship);
        Integer code = r.getCode();
        return code == HttpStatus.HTTP_OK;
    }

    public boolean unbind(DriverCarBindingRelationship driverCarBindingRelationship) {
        R<Void> r = serviceDriverUserClient.unbind(driverCarBindingRelationship);
        Integer code = r.getCode();
        return code == HttpStatus.HTTP_OK;
    }
    
    

}
